package edu.qust.y22.bean;

import java.util.ArrayList;
import java.util.List;

public class WebModel {
	
	//每页显示多少数据
	private int ps = 10;
	
	//当前显示第几页
	private int sp = 1;
	
	//共分多少页
	private int tp = 0;
	
	//共有多少条数据
	private int tc = 0;
	
	//存储数据
	private List data = new ArrayList();

	
	
	public void setTotalCount(int count){
		
		this.tc = count;
		this.tp = count / ps;
		if(count % ps > 0){
			tp = tp + 1;
		}		
	
	}
	
	public int getLimitStart(){
		return (sp - 1)*ps;	
	}
	
	
	////////////////////////////////////////////////

	public int getPs() {
		return ps;
	}

	public void setPs(int ps) {
		this.ps = ps;
	}

	public int getSp() {
		return sp;
	}

	public void setSp(int sp) {
		this.sp = sp;
	}

	public List getData() {
		return data;
	}

	public void setData(List data) {
		this.data = data;
	}

	public int getTp() {
		return tp;
	}

	public void setTp(int tp) {
		this.tp = tp;
	}

	public int getTc() {
		return tc;
	}

	public void setTc(int tc) {
		this.tc = tc;
	}

}
